package com.itheima.service.impl;

import com.itheima.data.Customer;
import com.itheima.data.RiskLevel;

public class RiskClassifier {
   /* CreditScoringModel creditScoringModel = new CreditScoringModel();
    Customer customer = new Customer();*/

    public  RiskLevel classifyRisk(int creditScore) {
        // 根据客户的信用评分将客户划分为不同的风险等级

        // 实现具体的风险分类算法  信用评分50以内 LOW  50-100 MEDIUM  100以上HIGH
        // 返回计算得到的风险等级
      //  int score = creditScoringModel.calculateCreditScore(customer);
        int score = creditScore;

        RiskLevel riskLevel = null;
        if (score < 50) {
            riskLevel = RiskLevel.LOW;
        }
        if (score < 100 && score >= 50) {
            riskLevel = RiskLevel.MEDIUM;
        }
        if (score >= 100) {
            riskLevel = RiskLevel.HIGH;
        }
        return riskLevel;
    }
}
